/*
 * Change Logs:
 * Date           Author       Notes
 * 2022-01-27     tyustli          first implementation
 */

#include "def.h"
#include "triplet.h"

Triplet T;
ElemType Value;

int main(int argc, char *argv[])
{
    Status i;

    printf("this is triplet test \r\n");

    InitTriplet(&T, 1, 2, 3);

    Get(T, 1, &Value);
    printf("%d \r\n", Value);

    Get(T, 2, &Value);
    printf("%d \r\n", Value);

    Get(T, 3, &Value);
    printf("%d \r\n", Value);

    i = Put(T, 2, 6); // 将三元组T的第2个值改为6

    i = IsAscending(T); // 此类函数实参与ElemType的类型无关,当ElemType的类型变化时,实参不需改变
    printf("调用测试升序的函数后，i=%d(0:否 1:是)\n", i);
    i = IsDescending(T);
    printf("调用测试降序的函数后，i=%d(0:否 1:是)\n", i);

    Get(T, 2, &Value);
    printf("%d \r\n", Value);

    DestroyTriplet(&T);

    return 0;
}
/*
编译：make
运行：./triplet
结果：
this is triplet test 
1 
2 
3 
调用测试升序的函数后，i=0(0:否 1:是)
调用测试降序的函数后，i=0(0:否 1:是)
6 
清除编译产物：make clean
*/
/****************** end of file ********************/
